# 导包
import jsonschema

# 编写被测数
data={
    "success": True,
    "code": 10000,
    "message": "操作成功",
    "money": 6.66,
    "address": None,
    "data": {
        "name": "tom"
    },
    "luckyNumber": [6, 8, 9]
}


# 编写schema
sch={
    "type":"object",
    "properties":{
        "success":{"type":"boolean"},
        "code":{"type":"integer"},
        "money":{"type":"number"},
        "address":{"type":"null"},
        "data":{"type":"object",
                "properties":
                    {"name":{"type":"string"}}
                },

        "luckyNumber":{"type":"array"}
    }

}

# 进行实际数据和json格式的验证
result=jsonschema.validate(instance=data,schema=sch)
print(result)